  <?php

    //require_once ("../../../snapol/framework.php");
    require "../../snapol/framework.php";   

    $order = $_REQUEST['order'];
    //$orderField = $_REQUEST['orderfield']; 
    //$table = $_REQUEST['table'];
    $table = "[php_property:table]";
    $sortableField = "[php_property:sortable_field]";
    $arrayOrder = explode(",", $order);     



    for ($n = 0; $n < sizeof($arrayOrder); $n++) {
        
//        echo $arrayOrder[$n]."<br>";    
        $sql = "UPDATE $table SET $sortableField=$n WHERE id=$arrayOrder[$n]";
        db::sqlExec($sql);
        
    }





?>
